package com.yitao.client.constant;

import java.util.HashMap;
import java.util.Map;

public class PushMessageEnum {


    public enum MsgTypeEnum {

        ANNOUNCE(1, "系统消息");

        private static final Map<Integer, MsgTypeEnum> map = new HashMap<>();

        static {
            MsgTypeEnum[] values = MsgTypeEnum.values();
            for (MsgTypeEnum item : values) {
                map.put(item.code, item);
            }
        }

        private final Integer code;
        private final String name;

        private MsgTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static MsgTypeEnum getEnum(Integer code) {
            return map.get(code);
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }


    public enum ClientTypeEnum {

        USER(1, "用户");

        private static final Map<Integer, ClientTypeEnum> map = new HashMap<>();

        static {
            ClientTypeEnum[] values = ClientTypeEnum.values();
            for (ClientTypeEnum item : values) {
                map.put(item.code, item);
            }
        }

        private final Integer code;
        private final String name;

        private ClientTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static ClientTypeEnum getEnum(Integer code) {
            return map.get(code);
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }


    public enum IsDeleteEnum {

        YES(1, "是"),
        NO(0, "否");

        private static final Map<Integer, IsDeleteEnum> map = new HashMap<>();

        static {
            IsDeleteEnum[] values = IsDeleteEnum.values();
            for (IsDeleteEnum item : values) {
                map.put(item.code, item);
            }
        }

        private final Integer code;
        private final String name;

        IsDeleteEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static IsDeleteEnum getEnum(Integer code) {
            return map.get(code);
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }

}
